Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add turbo_stream.refresh builder method #595

Merged
merged 1 commit into from
Sep 15, 2024

Conversation

seanpdoyle
Copy link
Contributor

Closes #579

Extends the turbo_stream tag builder helper to create <turbo-stream action="refresh"> elements through the pre-existing turbo_stream_refresh_tag method.

@OlegChuev
Copy link

Hi guys! Any updates/plans/ETA for this PR to be merged?

@radanskoric
Copy link

Would be nice to have this merged.

@rubiii
Copy link

rubiii commented Jun 30, 2024

Anything we can do to help get this shipped?

@seanpdoyle seanpdoyle force-pushed the turbo_stream_refresh branch from cea5764 to 46d9d5b Compare July 13, 2024 09:57
@seanpdoyle seanpdoyle force-pushed the turbo_stream_refresh branch from 46d9d5b to 0833e18 Compare July 22, 2024 13:22
@seanpdoyle
Copy link
Contributor Author

@jorgemanrubia what do you think about expanding the Tag Builder interface to support [action="refresh"]?

@adrianthedev
Copy link

I was just looking for this method.
Not having it looks like the API is incomplete.
It forces devs to create turbo_stream.erb files instead of handling it in the controller.

@radanskoric
Copy link

I was just looking for this method. Not having it looks like the API is incomplete. It forces devs to create turbo_stream.erb files instead of handling it in the controller.

@adrianthedev, while I hope this gets merged soon, you can still do it in the controller:

respond_to do |format|
  format.turbo_stream { render turbo_stream: turbo_stream.action(:refresh, "") }
end

This is also useful if you have your own custom actions.

@brendon
Copy link

brendon commented Aug 21, 2024

This would be great to have, though in my experience, adding the request-id means that the browser will ignore the refresh request (just like it ignores broadcast refresh requests with a matching request-id), or does this only apply to streamed refresh requests?

Closes [hotwired#579][]

Extends the `turbo_stream` tag builder helper to create `<turbo-stream
action="refresh">` elements through the pre-existing
`turbo_stream_refresh_tag` method.

[hotwired#579]: hotwired#579
@seanpdoyle seanpdoyle force-pushed the turbo_stream_refresh branch from 0833e18 to ee5e1f5 Compare August 29, 2024 17:21
@seanpdoyle
Copy link
Contributor Author

@jorgemanrubia @brunoprietog are either of you available to review this change?

@dhh dhh merged commit 9cd81b4 into hotwired:main Sep 15, 2024
15 checks passed
@seanpdoyle seanpdoyle deleted the turbo_stream_refresh branch September 15, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

refresh action is missing from Turbo::Streams::TagBuilder
7 participants